﻿using System.Xml.Linq;
using Maple.Weixin.MP.Helpers;

namespace Maple.Weixin.MP.Entities.Messages
{
    //public sealed class RequestMessageEventTemplateSendJobFinish : RequestMessageEventBase
    //{
    //    public TemplateSendJobFinishResult SendResult { get; private set; }

    //    public override Event Event
    //    {
    //        get { return Event.TEMPLATESENDJOBFINISH; }
    //    }

    //    protected override void FillPropertiesByXml(XDocument document)
    //    {
    //        base.FillPropertiesByXml(document);
    //        var status = document.GetElementValue("Status", true);
    //        switch (status) {
    //            case "success":
    //                this.SendResult = TemplateSendJobFinishResult.Success;
    //                break;
    //            case "failed:user block":
    //                this.SendResult = TemplateSendJobFinishResult.UserBlock;
    //                break;
    //            case "failed:system failed":
    //                this.SendResult = TemplateSendJobFinishResult.SystemFailed;
    //                break;
    //        }
    //    }

    //    #region Overrides of RequestMessageBase

    //    public override T Accept<T>(RequestMessageVisitor<T> visitor) {
    //        return visitor == null ? default(T) : visitor.Visit(this);
    //    }

    //    #endregion
    //}

    //public enum TemplateSendJobFinishResult
    //{
    //    Success,
    //    UserBlock,
    //    SystemFailed,
    //}
}
